package MoC;

import java.util.*;

import ptolemy.kernel.Entity;

import db.AtomicActorInfo;

//////////////////////////////////////////////////////////////////////////
//// ActorMessageLocation
/**

@author Ivan Jeukens
@version v 0.1 29/10/2002
*/
public class ActorMessageLocation extends MessageLocation {

    public ActorMessageLocation(int type) {
        super(type);
        _actorInstances = new LinkedList();
    }

    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public void addActor(Entity e) {
        _actorInstances.add(e);
    }
    
    public void setUsedByActors(LinkedList l) {
        for(int i = 0;i < l.size();i++) {
            AtomicActorInfo ainfo = (AtomicActorInfo) l.get(i);
            _actorInstances.add(ainfo.getActor());
        }
    }
    
    public Iterator actorInstancesIterator() {
        return _actorInstances.iterator();
    }

    ///////////////////////////////////////////////////////////////////
    ////                      protected variables                  ////

    ///////////////////////////////////////////////////////////////////
    ////                        private variables                  ////
   
    private LinkedList _actorInstances;
}
